<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li{
      height: 40px;
      width: 400px;
      background-color: #e7c3c3;
      margin-top: 10px;
    }
  </style>
</head>
<body>
  <div id="app">
      <button @click="changeMsg">修改msg</button>
      {{msg.a}}
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.7/vue.min.js"></script>
  <script>
    const vm = new Vue({
      data: {
        msg: {
        
          
        }
      },
      methods: {
        changeMsg(){
          // this.msg.a = '这是a属性';
          this.$set(this.msg, 'a', '这是a属性')
          console.log(this.msg);
        }
      },
    })
    vm.$mount('#app')
  </script>
</body>
</html>